<?xml version="1.0" encoding="UTF-8"?>
<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<ui:composition template="/WEB-INF/layout.xhtml"
                xmlns="http://www.w3.org/1999/xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:p="http://primefaces.org/ui">

    <bean id="exercicioController" class="controller.ExercicioController">
        <property name="pagina" value="alterarExercicio" />
    </bean>
    <ui:define name="content">
        <h:form id="form3">
            <p:panel id="panelAlterarExercicio" header="Alterar Exercicio">
                <h:panelGrid columns="6" style="margin-bottom:10px; width: 60%" cellpadding="5">
                    <p:outputLabel value="Grupo Muscular:"/>
                    <p:selectOneMenu  value="#{exercicioController.exercicio.grupoMuscular}">  
                        <f:selectItem itemLabel="Abdome" itemValue="Abdome"/>  
                        <f:selectItem itemLabel="Bíceps" itemValue="Bíceps"/>  
                        <f:selectItem itemLabel="Costas" itemValue="Costas"/>
                        <f:selectItem itemLabel="Coxa/Glúteo" itemValue="Coxa/Glúteo"/>
                        <f:selectItem itemLabel="Peito" itemValue="Peito"/>
                        <f:selectItem itemLabel="Perna" itemValue="Perna"/>
                        <f:selectItem itemLabel="Ombro" itemValue="Ombro"/>
                        <f:selectItem itemLabel="Tríceps" itemValue="Tríceps"/>
                    </p:selectOneMenu>
                    <p:spacer width="10" height="0" />
                    <p:outputLabel value="Nome:"/>
                    <p:inputText id="nome" value="#{exercicioController.exercicio.nome}" maxlength="30" size="52"
                                 required="true" requiredMessage="Informe o nome do exercício"/>
                    <p:message for="nome"/> 
                </h:panelGrid>
                
                <h:panelGrid columns="3">
                    <p:outputLabel value="Descrição:"/>
                    <p:spacer width="7" height="0" />
                    <p:inputTextarea value="#{exercicioController.exercicio.descricao}" rows="3" cols="80"/>
                </h:panelGrid>
                
                <p:commandButton value="Limpar" actionListener="#{exercicioController.limparCampos}" update="form3"/>
                <p:spacer width="10" height="50"/>
                <p:commandButton value="Salvar" actionListener="#{exercicioController.salvarExercicio}" update="panelAlterarExercicio"/>
                
                <p:dialog id="dialog" header="#{exercicioController.cabecalhoMsg}" widgetVar="exercicioDialog" resizable="false"  
                          showEffect="fade" hideEffect="explode">  
                    <h:panelGrid id="display" columns="2" cellpadding="4"> 
                        <h:outputText value="#{exercicioController.mensagem}" />  
                    </h:panelGrid>  
                </p:dialog>   
            </p:panel>
        </h:form>
    </ui:define>
</ui:composition>